package com.haidechizi.i18n.code.generator.common.message.reader;



import com.haidechizi.i18n.code.generator.common.message.utils.FileUtils;

import java.util.ArrayList;
import java.util.List;

public class FileReader implements Reader {
    /**
     * 获取所有文件的路径
     *
     * @param paths
     * @return
     */
    @Override
    public List<String> loadFiles(String... paths) {
        List<String> filePaths = new ArrayList<>(64);
        for (String path : paths) {
            FileUtils.loadFile(path, filePaths);
        }
        return filePaths;
    }


    /**
     * 读取文件内容
     *
     * @param path
     * @return
     */
    @Override
    public String readFile(String path) {
        return FileUtils.readFile(path);
    }
}
